package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.SafetyMapper;
import com.youlai.boot.system.mapper.SeedlingMapper;
import com.youlai.boot.system.model.QB.Seedling;
import com.youlai.boot.system.service.SeedlingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class SeedlingServiceImpl extends ServiceImpl<SeedlingMapper, Seedling> implements SeedlingService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private SeedlingMapper seedlingMapper;
    @Override
    public boolean saveSeedling(Seedling seedling) {

        seedling.setAddtime(LocalDateTime.now());
        return save(seedling);
    }

    @Override
    public List<Seedling> getAllSeedling() {
        return seedlingMapper.selectList(null);
    }

    @Override
    public boolean deleteSeedlingById(Integer id) {
        return seedlingMapper.deleteById(id)>0;
    }
}
